package com.huishu.file.controller;


import com.huishu.file.utils.GoFastdfsUtils;
import com.huishu.file.vo.UploadVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @ClassName：FileController
 * @Author: ljj
 * @Date: 2023/4/20 18:19
 */
@RestController
@RequestMapping("/")
public class FileController {

    private final Logger logger = LoggerFactory.getLogger(getClass());

    @RequestMapping("/upload")
    public UploadVO upload(@RequestParam("file") MultipartFile file) {
        logger.info("上传文件名称: {}", file.getOriginalFilename());
        return GoFastdfsUtils.upload(file);
    }
}
